﻿<div class="row g-3">
    <div class="col-12 col-sm-6">
        <Select Items="NullableIntItems" @bind-Value="SelectedIntItem">
        </Select>
    </div>
    <div class="col-12 col-sm-6">
        <div class="form-control">@GetSelectedIntItemString()</div>
    </div>
</div>

@code {
    private int? SelectedIntItem { get; set; }

    private string GetSelectedIntItemString()
    {
        return SelectedIntItem.HasValue ? SelectedIntItem.Value.ToString() : "null";
    }

    private IEnumerable<SelectedItem> NullableIntItems { get; set; } = new SelectedItem[]
    {
        new SelectedItem() { Text = "Item 1", Value = "" },
        new SelectedItem() { Text = "Item 2", Value = "2" },
        new SelectedItem() { Text = "Item 3", Value = "3" }
    };
}
